﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HDJ.Framework.Core
{
    /// <summary>
    /// 表格文本解析出来后类型关于的数据
    /// </summary>
    public class TableTypeData
    {
        /// <summary>
        /// 常用数据类型
        /// </summary>
        public static Dictionary<string, TableTypeData> CommonTableTypeData = new Dictionary<string, TableTypeData>()
        {
            { "string",new TableTypeData("string")},
             { "int",new TableTypeData("int")},
             { "float",new TableTypeData("float")},
            { "bool",new TableTypeData("bool")},
              { "Vector2",new TableTypeData("Vector2")},
               { "Vector3",new TableTypeData("Vector3")},

                { "string[]",new TableTypeData("string[]","array")},
                { "int[]",new TableTypeData("int[]","array")},
                { "float[]",new TableTypeData("float[]","array")},
                { "bool[]",new TableTypeData("bool[]","array")},
                { "Vector2[]",new TableTypeData("Vector2[]","array")},
                { "Vector3[]",new TableTypeData("Vector3[]","array")},
        };

       
        /// <summary>
        /// 类型（int,float,int[],bool[,],）
        /// </summary>
        public string dataType;
        /// <summary>
        /// 类型分类 如基本(base) 枚举(enum)或数组(array)或类(object)
        /// </summary>
        public string typeCategory;
        /// <summary>
        /// 标记用途（如多语言，图片，预制）
        /// </summary>
        public string tag;

        public TableTypeData() { }

        public TableTypeData(string typeKey)
        {
            this.dataType = typeKey;
        }
        public TableTypeData(string typeKey,string typeCategory)
        {
            this.dataType = typeKey;
            this.typeCategory = typeCategory;
        }
        public TableTypeData(string typeKey, string typeCategory,string tag)
        {
            this.dataType = typeKey;
            this.typeCategory = typeCategory;
            this.tag = tag;
        }

        public override string ToString()
        {
            return "dataType:"+ dataType+ " typeCategory:"+ typeCategory+" tag:"+tag;
        }
    }
}
